<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" placeholder="姓名" v-model="name">
    <input type="text" placeholder="工资" v-model="salary">
    <input type="text" placeholder="工作" v-model="job">
    <input type="button" value="添加" @click="f()"><br>
    <table border="1">
    <caption>员工列表</caption>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>工资</th>
        <th>工作</th>
    </tr>
    <tr v-for="(person,i) in arr">
        <th>{{i+1}}</th>
        <th>{{person.name}}</th>
        <th>{{person.salary}}</th>
        <th>{{person.job}}</th>
    </tr>
    </table>
</div>
<script src="../js/vue.js"></script>
<script>
    let v =new Vue({
        el:"div",
        data:{
            name:"",
            salary:"",
            job:"",
            arr:[{name:"孙慧德",salary: 5000,job:"了蓝"},
                {name:"付义",salary: 5000,job:"大了蓝"},
                {name:"晓龙",salary: 5000,job:"大大了蓝"}]
        },
        matches:{
          f(){
              //往arr数组中添加一个对象
              v.arr.push({name:v.name,salary:v.salary,job:v.job});
          }
        }
    })
</script>
</body>
</html>